{{ define "title" }}
{{ if eq .Data.Singular "tag" }}
{{ i18n "tag" }} | {{ .Data.Term }}
{{ else if eq .Data.Singular "category" }}
{{ i18n "category" }} | {{ .Data.Term }}
{{ else }}{{ end }}
{{ end }}

{{ define "frontmenu" }}
{{ $paginator := .Paginate (where .Data.Pages "Type" "post") (index .Site.Params "paginate" | default 6) }}
<nav class="ui top secondary menu" style="overflow-x: auto">
  <div class="item">
    <i class="inverted big link bullseye icon dream-flip-toggle" title="{{ i18n "flip" }}"></i>
  </div>
  <div class="item">
    <a href="/"><i class="inverted big link home icon" title="{{ i18n "home" }}"></i></a>
  </div>
  <div class="item">
    {{ if $paginator.HasPrev }}
    <a href="{{ $paginator.Prev.URL }}">
      <i class="inverted big arrow alternate circle outline left icon" title="{{ i18n "prevPage" }}"></i>
    </a>
    {{ else }}
    <i class="disabled inverted big arrow alternate circle outline left icon" title="{{ i18n "prevPage" }}"></i>
    {{ end }}
  </div>
  <div class="item">
    {{ if $paginator.HasNext }}
    <a href="{{ $paginator.Next.URL }}">
      <i class="inverted big arrow alternate circle outline right icon" title="{{ i18n "nextPage" }}"></i>
    </a>
    {{ else }}
    <i class="disabled inverted big arrow alternate circle outline right icon" title="{{ i18n "nextPage" }}"></i>
    {{ end }}
  </div>
</nav>
{{ end }}

{{ define "main"}}
<div class="ui centered grid">
  <div class="fifteen wide mobile fifteen wide tablet four wide computer column">

    {{ partial "header.html" . }}

  </div>
  <div class="fifteen wide mobile fifteen wide tablet eleven wide computer column post-list">

    <div class="ui two stackable cards">
      {{ $paginator := .Paginate (where .Data.Pages "Type" "post") (index .Site.Params "paginate" | default 6) }}
      {{ range $paginator.Pages }}

        {{ .Render "summary" }}

      {{ end }}
    </div>

  </div>
</div>
{{ end }}
